﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace igflow
{
    class igNode : GameObject.igGameObject
    {
        public List<GameObject.igGameObject> Links = new List<igflow.GameObject.igGameObject>();
        public igNode(Vector3 position,string name)
        {
            this.name = name;
            this.Position = position;
            World.AddGameObject(this);
        }
        public void Init()
        {
            Meshes.igTextMesh tMesh = new igflow.Meshes.igTextMesh(new igFont(), 0.15f, 0.15f, name, Color.Red);
            Components.igMeshRenderer rend = new igflow.Components.igMeshRenderer();
            rend.meshes.Add(tMesh);
            AddComponent(rend);
            //AddComponent(new igflow.Components.rotator());

            //testObject a = new testObject("pink");
            //AddChild(a);


        }

        internal void AddLink(igLink igLink)
        {
            Vector3 p = igLink.Position;
            Links.Add(igLink);
            igLink.parent = this;
            // link position has to be reset 
            igLink.Position = p;
        }
    }
}
